<template>
	<div class="div">
		<div class="div2">
			<h6>密码修改</h6>
			<hr>
			<p>
				<el-input v-model="pwd.oldPwd" placeholder="请输入旧密码" show-password></el-input>
				<el-input v-model="pwd.newPwd" placeholder="请输入新密码" show-password></el-input>
				<el-input v-model="pwd.newPwd2" placeholder="请确认新密码" show-password></el-input>
			</p>
			<el-button style="background-color: #f56c6c;color: white;" @click="updatePwd()">确认</el-button>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				pwd: {
					oldPwd: '',
					newPwd: '',
					newPwd2: '',
				}

			}
		},
		methods: {
			updatePwd() {
				this.$postk("/api/user/updatePwd/", this.pwd).then((resp) => {
					console.log(resp.data);
					this.$message({
						message: '修改成功',
						type: 'success'
					});
				})
			}
		},
		mounted() {}
	}
</script>

<style scoped>
	.div {
		width: 100%;
	}

	.div .div2 {
		width: 100%;
		margin-top: 5vh;
		text-align: center;
	}

	.div .div2 hr {
		margin: 0 auto;
		width: 80%;
		border: 1px solid aqua;
	}

	.div .div2 p {
		width: 65%;
		margin: 0 auto;
	}

	.div .div2 p .el-input {
		margin-top: 10vh;
	}
</style>